import { Form, Table } from 'antd';
import Cls from 'classnames';
import { useContext, useEffect, useMemo, useState } from 'react';
import { connect } from 'umi';
import { getTableColumns } from '../mconfig/TransferTablecolumn';

const TransferView: React.FC<any> = ({ curRes }) => {
  const getTableColumn: Record<string, any>[] = useMemo(() => {
    return getTableColumns();
  }, [curRes]);

  return (
    <div className={Cls('list-table', 'descriptionsType-tableSty', 'descriptionsType-tableFormSty')}>
      <Form.Item name="processList" valuePropName="dataSource">
        <Table
          columns={getTableColumn}
          bordered
          size="small"
          dataSource={[]}
          // rowKey={(res) => (res?.id ? res?.id : res?.key)}
          scroll={{ x: 1200, y: '' }}
          pagination={false}
        />
      </Form.Item>
    </div>
  );
};

export default connect(({ baseLogin, navTab }: Record<string, any>) => ({
  curRes: baseLogin?.permissions,
  navTab,
}))(TransferView);
